package cn.changein.framework.admin.other.controller;

import cn.changein.framework.kernel.model.response.ResponseData;
import cn.changein.framework.model.other.CheckUpdateDTO;
import cn.changein.framework.service.other.OtherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**

 */
@Controller
@RequestMapping("other")
public class OtherController {

    @Autowired
    OtherService otherService;

    @RequestMapping("updateConfig")
    public String index() {
        return "/other/updateConfig.html";
    }

    /**
     * 配置app更新
     */
    @RequestMapping("configUpdate")
    @ResponseBody
    public ResponseData configUpdate(@RequestBody CheckUpdateDTO checkUpdateDTO) {
        return otherService.configUpdate(checkUpdateDTO);
    }


    /**
     * 获取app更新配置详情
     */
    @RequestMapping("getUpdateConfig")
    @ResponseBody
    public ResponseData getUpdateConfig() {
        return otherService.getUpdateConfig(null);
    }
}
